package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("delivery/distributor")
public @caption("配送商信息") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("distributor") class Distributor implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("id")    @primary  @notnull  @note("  ") Long id;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("配送商名称") @column("name") @like    @notnull  @note("  ") String name;// 非空     
			
 			
 			
 		
	
		
	private @caption("店面图片") @column("shop_picture")      @note("  ") String shopPicture;//     
			
 			
 			
 		
	
		
	private @caption("手机号") @column("mobile") @like    @notnull  @note("  ") String mobile;// 非空     
			
 			
 			
 		
	
		
	private @caption("联系人") @column("contacts")      @note("  ") String contacts;//     
			
 			
 			
 		
	
		
	private @caption("密码") @column("password")     @notnull  @note("  ") String password;// 非空     
			
 			
 			
 		
	
		
	private @caption("配送商地址") @column("address") @like  @hidden    @note("  ") String address;//     
			
 			
 			
 		
	
		
	private @caption("所在地") @column("location")      @relate("$location") @RelateClass(Region.class)  @note("  ") Long location;//     
			
 	private transient Region $location;//关联对象[省市地区]
 			
 			
 			
 		
	
		
	private @caption("会员信息") @column("member")   @hidden   @notnull  @relate("$member") @RelateClass(Member.class)  @note("  ") Long member;// 非空     
			
 	private transient Member $member;//关联对象[会员信息]
 			
 			
 			
 		
	
		
	private transient @caption("会员名称") @column("nick_name") @like     @note("  ") String nickName;//     
			
 			
 			
 		
	
		
	private @caption("提货时间") @column("delivery_time")      @note("  ") String deliveryTime;//     
			
 			
 			
 		
	
		
	private @caption("经度") @column("longitude")      @note("  ") String longitude;//     
			
 			
 			
 		
	
		
	private @caption("纬度") @column("latitude")      @note("  ") String latitude;//     
			
 			
 			
 		
	
		
	private @caption("条款情况") @column("terms_conditions")      @note(" 1:同意 2:不同意  ") Short termsConditions;// 1:同意 2:不同意     
			
 			
 			
 		
	
		
	private @caption("资料完善") @column("perfect_situation")      @note(" 1:未完善 2:已完善  ") Short perfectSituation;// 1:未完善 2:已完善     
			
 			
 			
 		
	
		
	private @caption("坐标地址") @column("coordinate_address") @like  @hidden    @note("  ") String coordinateAddress;//     
			
 			
 			
 		
	
		
	private @caption("审核意见") @column("audit_opinion") @like  @hidden    @note("  ") String auditOpinion;//     
			
 			
 			
 		
	
		
	private @caption("formId") @column("d_formid")   @hidden    @note("  ") String dFormid;//     
			
 			
 			
 		
	
		
	private @caption("修改时间") @column("update_time")     @notnull  @note("  ") Date updateTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("add_time")     @notnull  @note("  ") Date addTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("状态") @column("status")     @notnull  @note(" 0:审核中 1:审核通过 2:审核拒绝 3:禁用账号  ") Short status;// 非空 0:审核中 1:审核通过 2:审核拒绝 3:禁用账号     
			
 			
 			
 		
	
	 
	//默认构造函数
	public Distributor(){ 
	
	}
	
	//主键构造函数
	public Distributor(Long id){
		this.id = id;
	}
	
	/**所有字段构造函数 
	 Distributor(
	 	Utils.getString("")//配送商名称 [非空]
	 	,Utils.getString("picture")//店面图片
	 	,Utils.getString("")//手机号 [非空]
	 	,Utils.getString("")//联系人
	 	,Utils.getString("")//密码 [非空]
	 	,Utils.getString("")//配送商地址
	 	,Utils.getLong("")//所在地
	 	,Utils.getLong("")//会员信息 [非空]
	 	,Utils.getString("time")//提货时间
	 	,Utils.getString("")//经度
	 	,Utils.getString("")//纬度
	 	,Utils.getShort("conditions")//条款情况
	 	,Utils.getShort("situation")//资料完善
	 	,Utils.getString("address")//坐标地址
	 	,Utils.getString("opinion")//审核意见
	 	,Utils.getString("formid")//formId
	 	,Utils.getDate("time")//修改时间 [非空]
	 	,Utils.getDate("time")//添加时间 [非空]
	 	,Utils.getShort("")//状态 [非空]
	 )
	**/
	public Distributor(String name,String shopPicture,String mobile,String contacts,String password,String address,Long location,Long member,String deliveryTime,String longitude,String latitude,Short termsConditions,Short perfectSituation,String coordinateAddress,String auditOpinion,String dFormid,Date updateTime,Date addTime,Short status){
		
			
			
		this.name=name;
		
			
		this.shopPicture=shopPicture;
		
			
		this.mobile=mobile;
		
			
		this.contacts=contacts;
		
			
		this.password=password;
		
			
		this.address=address;
		
			
		this.location=location;
		
			
		this.member=member;
		
			
			
		this.deliveryTime=deliveryTime;
		
			
		this.longitude=longitude;
		
			
		this.latitude=latitude;
		
			
		this.termsConditions=termsConditions;
		
			
		this.perfectSituation=perfectSituation;
		
			
		this.coordinateAddress=coordinateAddress;
		
			
		this.auditOpinion=auditOpinion;
		
			
		this.dFormid=dFormid;
		
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
	}
	
	//设置非空字段
	public Distributor setNotNull(String name,String mobile,String password,Long member,Date updateTime,Date addTime,Short status){
		
			
			
		this.name=name;
		
			
			
		this.mobile=mobile;
		
			
			
		this.password=password;
		
			
			
			
		this.member=member;
		
			
			
			
			
			
			
			
			
			
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public Distributor id(Long id){
		this.id = id;
		this.setSeted(F.id);
		return this;
	}
	
		
	/** 配送商名称 [非空]       **/
	public Distributor name(String name){
		this.name = name;
		this.setSeted(F.name);
		return this;
	}
	
		
	/** 店面图片        **/
	public Distributor shopPicture(String shopPicture){
		this.shopPicture = shopPicture;
		this.setSeted(F.shopPicture);
		return this;
	}
	
		
	/** 手机号 [非空]       **/
	public Distributor mobile(String mobile){
		this.mobile = mobile;
		this.setSeted(F.mobile);
		return this;
	}
	
		
	/** 联系人        **/
	public Distributor contacts(String contacts){
		this.contacts = contacts;
		this.setSeted(F.contacts);
		return this;
	}
	
		
	/** 密码 [非空]       **/
	public Distributor password(String password){
		this.password = password;
		this.setSeted(F.password);
		return this;
	}
	
		
	/** 配送商地址        **/
	public Distributor address(String address){
		this.address = address;
		this.setSeted(F.address);
		return this;
	}
	
		
	/** 所在地  [Region]      **/
	public Distributor location(Long location){
		this.location = location;
		this.setSeted(F.location);
		return this;
	}
	
		
	/** 会员信息 [非空] [Member]      **/
	public Distributor member(Long member){
		this.member = member;
		this.setSeted(F.member);
		return this;
	}
	
		
		
	/** 提货时间        **/
	public Distributor deliveryTime(String deliveryTime){
		this.deliveryTime = deliveryTime;
		this.setSeted(F.deliveryTime);
		return this;
	}
	
		
	/** 经度        **/
	public Distributor longitude(String longitude){
		this.longitude = longitude;
		this.setSeted(F.longitude);
		return this;
	}
	
		
	/** 纬度        **/
	public Distributor latitude(String latitude){
		this.latitude = latitude;
		this.setSeted(F.latitude);
		return this;
	}
	
		
	/** 条款情况    1:同意 2:不同意     **/
	public Distributor termsConditions(Short termsConditions){
		this.termsConditions = termsConditions;
		this.setSeted(F.termsConditions);
		return this;
	}
	
		
	/** 资料完善    1:未完善 2:已完善     **/
	public Distributor perfectSituation(Short perfectSituation){
		this.perfectSituation = perfectSituation;
		this.setSeted(F.perfectSituation);
		return this;
	}
	
		
	/** 坐标地址        **/
	public Distributor coordinateAddress(String coordinateAddress){
		this.coordinateAddress = coordinateAddress;
		this.setSeted(F.coordinateAddress);
		return this;
	}
	
		
	/** 审核意见        **/
	public Distributor auditOpinion(String auditOpinion){
		this.auditOpinion = auditOpinion;
		this.setSeted(F.auditOpinion);
		return this;
	}
	
		
	/** formId        **/
	public Distributor dFormid(String dFormid){
		this.dFormid = dFormid;
		this.setSeted(F.dFormid);
		return this;
	}
	
		
	/** 修改时间 [非空]       **/
	public Distributor updateTime(Date updateTime){
		this.updateTime = updateTime;
		this.setSeted(F.updateTime);
		return this;
	}
	
		
	/** 添加时间 [非空]       **/
	public Distributor addTime(Date addTime){
		this.addTime = addTime;
		this.setSeted(F.addTime);
		return this;
	}
	
		
	/** 状态 [非空]   0:审核中 1:审核通过 2:审核拒绝 3:禁用账号     **/
	public Distributor status(Short status){
		this.status = status;
		this.setSeted(F.status);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public Distributor clone(){
		Distributor clone = new Distributor();
		
			
			
		clone.name=this.name;
		
			
		clone.shopPicture=this.shopPicture;
		
			
		clone.mobile=this.mobile;
		
			
		clone.contacts=this.contacts;
		
			
		clone.password=this.password;
		
			
		clone.address=this.address;
		
			
		clone.location=this.location;
		
			
		clone.member=this.member;
		
			
			
		clone.deliveryTime=this.deliveryTime;
		
			
		clone.longitude=this.longitude;
		
			
		clone.latitude=this.latitude;
		
			
		clone.termsConditions=this.termsConditions;
		
			
		clone.perfectSituation=this.perfectSituation;
		
			
		clone.coordinateAddress=this.coordinateAddress;
		
			
		clone.auditOpinion=this.auditOpinion;
		
			
		clone.dFormid=this.dFormid;
		
			
		clone.updateTime=this.updateTime;
		
			
		clone.addTime=this.addTime;
		
			
		clone.status=this.status;
		
		return clone;
	}
	
	
	
	/**
	* 清除缓存
	**/
	public void clear(){
		Cache.clearObject(Distributor.M.class);
		Cache.clearValue(Distributor.M.class);
		Cache.deleteObject(Distributor.class, this.getId());
	}
	
	/**
	* 清除缓存
	**/
	public static void clear(Long id){
		Cache.clearObject(Distributor.M.class);
		Cache.clearValue(Distributor.M.class);
		Cache.deleteObject(Distributor.class, id);
	}
	
	
	
	/**
	 * 根据ID取配送商信息
	 * @param id
	 * @return
	 */
	public static @api Distributor get(Long id){		
		return getDistributorById(id);
	}
	
	
	
	/**
	 * 获取所有配送商信息
	 * @return
	 */
	public static @api List<Distributor> list(Map params,Integer size){
		return getDistributorList(params,size);
	}
	/**
	 * 获取配送商信息分页
	 * @return
	 */
	public static @api Page<Distributor> page(Integer page,Integer size,Map params){
		return getDistributorPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取配送商信息
	 * @param params
	 * @return
	 */
	public static @api Distributor Get(Map params){
		return getDistributor(params);
	}
	/**
	 * 获取配送商信息数
	 * @return
	 */
	public static @api Long count(Map params){
		return getDistributorCount(params);
	}
	/**
	 * 获取配送商信息数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getDistributorEval(eval,params);
	}
	
	
	/**
	 * 获取配送商信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getDistributorStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取配送商信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getDistributorStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取配送商信息
	 * @param id
	 * @return
	 */
	public static @api Distributor getDistributorById(Long id){		
		return getDistributorDao().getDistributorById(id);
	}
	
	
	
	
	/**
	 * 根据ID取配送商信息的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(Distributor.class, id);
				
		if(value==null){
			Distributor distributor = get(id);
			if(distributor!=null){
				String strValue = distributor.getMobile$();
				
				if(!"Mobile".equals("Name"))
					strValue+="("+distributor.getName$()+")";
				
				if(!"Mobile".equals("Mobile"))
					strValue+="("+distributor.getMobile$()+")";
				
				
				Cache.setValue(Distributor.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(Distributor.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getMobile$();
		
		if(!"Mobile".equals("Name"))
			keyValue+="("+this.getName$()+")";
		
		if(!"Mobile".equals("Mobile"))
			keyValue+="("+this.getMobile$()+")";
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询配送商信息对象
	 * @return
	 */
	public static @api Distributor find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("id", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex+=" or name = '"+key.replaceAll("'", "''")+"'";
			
			strDefinex+=" or mobile = '"+key.replaceAll("'", "''")+"'";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return Distributor.getDistributor(params);
	}
	
	
	/**
	 * 根据关键字查询配送商信息
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("id", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex+=" or name like '%"+strTerm.replaceAll("'", "''")+"%'";
				
				strDefinex+=" or mobile like '%"+strTerm.replaceAll("'", "''")+"%'";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<Distributor> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(Distributor distributor:list){
			Map map = new HashMap();
			map.put("key",distributor.getId().toString());
			map.put("value", Utils.js(distributor.getKeyValue()));
			if(bObject==true)
				map.put("object",distributor);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有配送商信息
	 * @return
	 */
	public static @api List<Distributor> getDistributorList(Map params,Integer size){
		return getDistributorDao().getDistributorList(params,0,size);
	}
	
	/**
	 * 获取配送商信息分页
	 * @return
	 */
	public static @api Page<Distributor> getDistributorPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getDistributorDao().getDistributorPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取配送商信息
	 * @param params
	 * @return
	 */
	public static @api Distributor getDistributor(Map params){
		return getDistributorDao().getDistributor(params);
	}
	
	/**
	 * 保存一个配送商信息
	 * @param distributor
	 * @return
	 */
	public static @api Distributor saveDistributor(Distributor distributor){
		return getDistributorDao().saveDistributor(distributor);
	}
	
	/**
	 * 根据条件更新配送商信息
	 * @param values
	 * @param params
	 */
	public static @api int updateDistributorByConfirm(Map values, Map params){
		return getDistributorDao().updateDistributorByConfirm(values,params);
	}
	
	/**
	 * 修改一个配送商信息
	 * @param distributor
	 * @return
	 */
	public static @api int updateDistributor(Distributor distributor){
		return getDistributorDao().updateDistributor(distributor);
	}
	
	/**
	 * 更新配送商信息非空字段
	 * @param distributor
	 */
	public static @api int updateDistributor$NotNull(Distributor distributor){
		return getDistributorDao().updateDistributor$NotNull(distributor);
	}
	
	/**
	 * 获取配送商信息数
	 * @return
	 */
	public static @api Long getDistributorCount(Map params){
		return getDistributorDao().getDistributorCount(params);
	}
		
		
	/**
	 * 获取配送商信息自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getDistributorEval(String eval,Map params){
		return getDistributorDao().getDistributorEval(eval,params);
	}
	
	
	/**
	 * 获取配送商信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getDistributorStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getDistributorDao().getDistributorStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = Distributor.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(Distributor.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateDistributor(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getDistributorDao().updateDistributorByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteDistributor(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getDistributorDao().deleteDistributorByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getDistributorDao().removeDistributorById(id);
		
	}
	
	
	/**
	 * 保存配送商信息对象
	 * @param params
	 * @return
	 */
	public Distributor save(){
		if(this.getId()!=null)
			getDistributorDao().updateDistributor(this);
		else
			return getDistributorDao().saveDistributor(this);
		return this;
	}
	
	
	/**
	 * 更新配送商信息对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getDistributorDao().updateDistributor$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
		if(Utils.equals(Utils.config("logic_delete"),"true"))
			getDistributorDao().removeDistributorById(this.getId());
		else
		
			getDistributorDao().deleteDistributorById(this.getId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getDistributorDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getId(){
		
		if(this.id!=null){
			return this.id;
		}
		
		return this.id;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setId$(String strValue){
		if(Utils.empty(strValue)){
			this.id=null;
			return;
		}
	
	
	 	this.id=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setId(Long id){
		this.id = id;
		
		this.setSeted(F.id);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商名称**********************************/	
	/**
	* 配送商名称 [非空]      
	**/
	public String getName(){
		
		if(this.name!=null){
			return this.name;
		}
		
		return this.name;
	}
	/**
	* 获取配送商名称格式化(toString)
	**/
	public String getName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getName());
	 
	 	 return strValue;
	}
	/**
	* 根据配送商名称反格式化
	**/
	public void setName$(String strValue){
		if(Utils.empty(strValue)){
			this.name=null;
			return;
		}
	
	
	 	this.name=strValue;
	 
	}
	
	/**
	* 配送商名称 [非空]      
	**/
	public void setName(String name){
		this.name = name;
		
		this.setSeted(F.name);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************店面图片**********************************/	
	/**
	* 店面图片       
	**/
	public String getShopPicture(){
		
		if(this.shopPicture!=null){
			return this.shopPicture;
		}
		
		return this.shopPicture;
	}
	/**
	* 获取店面图片格式化(toString)
	**/
	public String getShopPicture$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getShopPicture());
	 
	 	 return strValue;
	}
	/**
	* 根据店面图片反格式化
	**/
	public void setShopPicture$(String strValue){
		if(Utils.empty(strValue)){
			this.shopPicture=null;
			return;
		}
	
	
		this.shopPicture=Utils.parseString(strValue);
	 
	}
	
	/**
	* 店面图片       
	**/
	public void setShopPicture(String shopPicture){
		this.shopPicture = shopPicture;
		
		this.setSeted(F.shopPicture);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************手机号**********************************/	
	/**
	* 手机号 [非空]      
	**/
	public String getMobile(){
		
		if(this.mobile!=null){
			return this.mobile;
		}
		
		return this.mobile;
	}
	/**
	* 获取手机号格式化(toString)
	**/
	public String getMobile$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getMobile());
	 
	 	 return strValue;
	}
	/**
	* 根据手机号反格式化
	**/
	public void setMobile$(String strValue){
		if(Utils.empty(strValue)){
			this.mobile=null;
			return;
		}
	
	
	 	this.mobile=strValue;
	 
	}
	
	/**
	* 手机号 [非空]      
	**/
	public void setMobile(String mobile){
		this.mobile = mobile;
		
		this.setSeted(F.mobile);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************联系人**********************************/	
	/**
	* 联系人       
	**/
	public String getContacts(){
		
		if(this.contacts!=null){
			return this.contacts;
		}
		
		return this.contacts;
	}
	/**
	* 获取联系人格式化(toString)
	**/
	public String getContacts$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getContacts());
	 
	 	 return strValue;
	}
	/**
	* 根据联系人反格式化
	**/
	public void setContacts$(String strValue){
		if(Utils.empty(strValue)){
			this.contacts=null;
			return;
		}
	
	
	 	this.contacts=strValue;
	 
	}
	
	/**
	* 联系人       
	**/
	public void setContacts(String contacts){
		this.contacts = contacts;
		
		this.setSeted(F.contacts);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************密码**********************************/	
	/**
	* 密码 [非空]      
	**/
	public String getPassword(){
		
		if(this.password!=null){
			return this.password;
		}
		
		return this.password;
	}
	/**
	* 获取密码格式化(toString)
	**/
	public String getPassword$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getPassword());
	 
	 	 return strValue;
	}
	/**
	* 根据密码反格式化
	**/
	public void setPassword$(String strValue){
		if(Utils.empty(strValue)){
			this.password=null;
			return;
		}
	
	
	 	this.password=strValue;
	 
	}
	
	/**
	* 密码 [非空]      
	**/
	public void setPassword(String password){
		this.password = password;
		
		this.setSeted(F.password);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商地址**********************************/	
	/**
	* 配送商地址       
	**/
	public String getAddress(){
		
		if(this.address!=null){
			return this.address;
		}
		
		return this.address;
	}
	/**
	* 获取配送商地址格式化(toString)
	**/
	public String getAddress$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getAddress());
	 
	 	 return strValue;
	}
	/**
	* 根据配送商地址反格式化
	**/
	public void setAddress$(String strValue){
		if(Utils.empty(strValue)){
			this.address=null;
			return;
		}
	
	
		this.address=strValue;
	 
	}
	
	/**
	* 配送商地址       
	**/
	public void setAddress(String address){
		this.address = address;
		
		this.setSeted(F.address);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************所在地**********************************/	
	/**
	* 所在地  [Region]     
	**/
	public Long getLocation(){
		
		if(this.location!=null){
			return this.location;
		}
		
		return this.location;
	}
	/**
	* 获取所在地格式化(toString)
	**/
	public String getLocation$(){
		String strValue="";
	
	
		 
		if(this.getLocation()!=null){
			
				strValue+=Utils.string(Region.getKeyValue(this.getLocation()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据所在地反格式化
	**/
	public void setLocation$(String strValue){
		if(Utils.empty(strValue)){
			this.location=null;
			return;
		}
	
	
		 
		Region item = Region.find(strValue);
		if(item!=null){
			
			this.location = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 所在地  [Region]     
	**/
	public void setLocation(Long location){
		this.location = location;
		
		this.setSeted(F.location);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[省市地区]
	**/	 			
 	public Region get$location(){
 		if(this.$location!=null)
 			return this.$location;
 		com.distribute.framework.model.Region region = null;
		if(this.getLocation()!=null){
		
 			region = Region.get(this.getLocation());
 		
 		}
 		return region;
	}
	
 	
	
	
	/*******************************会员信息**********************************/	
	/**
	* 会员信息 [非空] [Member]     
	**/
	public Long getMember(){
		
		if(this.member!=null){
			return this.member;
		}
		
		return this.member;
	}
	/**
	* 获取会员信息格式化(toString)
	**/
	public String getMember$(){
		String strValue="";
	
	
		 
		if(this.getMember()!=null){
			
				strValue+=Utils.string(Member.getKeyValue(this.getMember()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据会员信息反格式化
	**/
	public void setMember$(String strValue){
		if(Utils.empty(strValue)){
			this.member=null;
			return;
		}
	
	
		 
		Member item = Member.find(strValue);
		if(item!=null){
			
			this.member = Utils.parseLong(item.getUid());
			
		}
		 
	 
	}
	
	/**
	* 会员信息 [非空] [Member]     
	**/
	public void setMember(Long member){
		this.member = member;
		
		this.setSeted(F.member);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[会员信息]
	**/	 			
 	public Member get$member(){
 		if(this.$member!=null)
 			return this.$member;
 		com.distribute.framework.model.Member member = null;
		if(this.getMember()!=null){
		
 			member = Member.get(this.getMember());
 		
 		}
 		return member;
	}
	
 	
	
	
	/*******************************会员名称**********************************/	
	/**
	* 会员名称       
	**/
	public String getNickName(){
		
		if(this.nickName!=null){
			return this.nickName;
		}
		
		Member member = Member.get(this.getMember());
		if(member!=null){
			this.nickName=member.getNickName();
		}
				
		
		return this.nickName;
	}
	/**
	* 获取会员名称格式化(toString)
	**/
	public String getNickName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getNickName());
	 
	 	 return strValue;
	}
	/**
	* 根据会员名称反格式化
	**/
	public void setNickName$(String strValue){
		if(Utils.empty(strValue)){
			this.nickName=null;
			return;
		}
	
	
	 	this.nickName=strValue;
	 
	}
	
	/**
	* 会员名称       
	**/
	public void setNickName(String nickName){
		this.nickName = nickName;
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************提货时间**********************************/	
	/**
	* 提货时间       
	**/
	public String getDeliveryTime(){
		
		if(this.deliveryTime!=null){
			return this.deliveryTime;
		}
		
		return this.deliveryTime;
	}
	/**
	* 获取提货时间格式化(toString)
	**/
	public String getDeliveryTime$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getDeliveryTime());
	 
	 	 return strValue;
	}
	/**
	* 根据提货时间反格式化
	**/
	public void setDeliveryTime$(String strValue){
		if(Utils.empty(strValue)){
			this.deliveryTime=null;
			return;
		}
	
	
	 	this.deliveryTime=strValue;
	 
	}
	
	/**
	* 提货时间       
	**/
	public void setDeliveryTime(String deliveryTime){
		this.deliveryTime = deliveryTime;
		
		this.setSeted(F.deliveryTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************经度**********************************/	
	/**
	* 经度       
	**/
	public String getLongitude(){
		
		if(this.longitude!=null){
			return this.longitude;
		}
		
		return this.longitude;
	}
	/**
	* 获取经度格式化(toString)
	**/
	public String getLongitude$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getLongitude());
	 
	 	 return strValue;
	}
	/**
	* 根据经度反格式化
	**/
	public void setLongitude$(String strValue){
		if(Utils.empty(strValue)){
			this.longitude=null;
			return;
		}
	
	
	 	this.longitude=strValue;
	 
	}
	
	/**
	* 经度       
	**/
	public void setLongitude(String longitude){
		this.longitude = longitude;
		
		this.setSeted(F.longitude);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************纬度**********************************/	
	/**
	* 纬度       
	**/
	public String getLatitude(){
		
		if(this.latitude!=null){
			return this.latitude;
		}
		
		return this.latitude;
	}
	/**
	* 获取纬度格式化(toString)
	**/
	public String getLatitude$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getLatitude());
	 
	 	 return strValue;
	}
	/**
	* 根据纬度反格式化
	**/
	public void setLatitude$(String strValue){
		if(Utils.empty(strValue)){
			this.latitude=null;
			return;
		}
	
	
	 	this.latitude=strValue;
	 
	}
	
	/**
	* 纬度       
	**/
	public void setLatitude(String latitude){
		this.latitude = latitude;
		
		this.setSeted(F.latitude);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************条款情况**********************************/	
	/**
	* 条款情况    1:同意 2:不同意    
	**/
	public Short getTermsConditions(){
		
		if(this.termsConditions!=null){
			return this.termsConditions;
		}
		
		return this.termsConditions;
	}
	/**
	* 获取条款情况格式化(toString)
	**/
	public String getTermsConditions$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getTermsConditions()),"1"))
			strValue=Utils.string("同意");		 
			
		 if(Utils.equals(Utils.string(this.getTermsConditions()),"2"))
			strValue=Utils.string("不同意");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据条款情况反格式化
	**/
	public void setTermsConditions$(String strValue){
		if(Utils.empty(strValue)){
			this.termsConditions=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"同意"))
		 	this.termsConditions=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"不同意"))
		 	this.termsConditions=Utils.parseShort("2");
			
		
	 
	}
	
	/**
	* 条款情况    1:同意 2:不同意    
	**/
	public void setTermsConditions(Short termsConditions){
		this.termsConditions = termsConditions;
		
		this.setSeted(F.termsConditions);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************资料完善**********************************/	
	/**
	* 资料完善    1:未完善 2:已完善    
	**/
	public Short getPerfectSituation(){
		
		if(this.perfectSituation!=null){
			return this.perfectSituation;
		}
		
		return this.perfectSituation;
	}
	/**
	* 获取资料完善格式化(toString)
	**/
	public String getPerfectSituation$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getPerfectSituation());
	 
	 	 return strValue;
	}
	/**
	* 根据资料完善反格式化
	**/
	public void setPerfectSituation$(String strValue){
		if(Utils.empty(strValue)){
			this.perfectSituation=null;
			return;
		}
	
	
	 	this.perfectSituation=Utils.parseShort(strValue);
	 
	}
	
	/**
	* 资料完善    1:未完善 2:已完善    
	**/
	public void setPerfectSituation(Short perfectSituation){
		this.perfectSituation = perfectSituation;
		
		this.setSeted(F.perfectSituation);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************坐标地址**********************************/	
	/**
	* 坐标地址       
	**/
	public String getCoordinateAddress(){
		
		if(this.coordinateAddress!=null){
			return this.coordinateAddress;
		}
		
		return this.coordinateAddress;
	}
	/**
	* 获取坐标地址格式化(toString)
	**/
	public String getCoordinateAddress$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getCoordinateAddress());
	 
	 	 return strValue;
	}
	/**
	* 根据坐标地址反格式化
	**/
	public void setCoordinateAddress$(String strValue){
		if(Utils.empty(strValue)){
			this.coordinateAddress=null;
			return;
		}
	
	
		this.coordinateAddress=strValue;
	 
	}
	
	/**
	* 坐标地址       
	**/
	public void setCoordinateAddress(String coordinateAddress){
		this.coordinateAddress = coordinateAddress;
		
		this.setSeted(F.coordinateAddress);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************审核意见**********************************/	
	/**
	* 审核意见       
	**/
	public String getAuditOpinion(){
		
		if(this.auditOpinion!=null){
			return this.auditOpinion;
		}
		
		return this.auditOpinion;
	}
	/**
	* 获取审核意见格式化(toString)
	**/
	public String getAuditOpinion$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getAuditOpinion());
	 
	 	 return strValue;
	}
	/**
	* 根据审核意见反格式化
	**/
	public void setAuditOpinion$(String strValue){
		if(Utils.empty(strValue)){
			this.auditOpinion=null;
			return;
		}
	
	
		this.auditOpinion=strValue;
	 
	}
	
	/**
	* 审核意见       
	**/
	public void setAuditOpinion(String auditOpinion){
		this.auditOpinion = auditOpinion;
		
		this.setSeted(F.auditOpinion);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************formId**********************************/	
	/**
	* formId       
	**/
	public String getdFormid(){
		
		if(this.dFormid!=null){
			return this.dFormid;
		}
		
		return this.dFormid;
	}
	/**
	* 获取formId格式化(toString)
	**/
	public String getdFormid$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getdFormid());
	 
	 	 return strValue;
	}
	/**
	* 根据formId反格式化
	**/
	public void setdFormid$(String strValue){
		if(Utils.empty(strValue)){
			this.dFormid=null;
			return;
		}
	
	
	 	this.dFormid=strValue;
	 
	}
	
	/**
	* formId       
	**/
	public void setdFormid(String dFormid){
		this.dFormid = dFormid;
		
		this.setSeted(F.dFormid);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************修改时间**********************************/	
	/**
	* 修改时间 [非空]      
	**/
	public Date getUpdateTime(){
		
		if(this.updateTime!=null){
			return this.updateTime;
		}
		
		return this.updateTime;
	}
	/**
	* 获取修改时间格式化(toString)
	**/
	public String getUpdateTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getUpdateTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据修改时间反格式化
	**/
	public void setUpdateTime$(String strValue){
		if(Utils.empty(strValue)){
			this.updateTime=null;
			return;
		}
	
	
	 	this.updateTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 修改时间 [非空]      
	**/
	public void setUpdateTime(Date updateTime){
		this.updateTime = updateTime;
		
		this.setSeted(F.updateTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间 [非空]      
	**/
	public Date getAddTime(){
		
		if(this.addTime!=null){
			return this.addTime;
		}
		
		return this.addTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.addTime=null;
			return;
		}
	
	
	 	this.addTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间 [非空]      
	**/
	public void setAddTime(Date addTime){
		this.addTime = addTime;
		
		this.setSeted(F.addTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************状态**********************************/	
	/**
	* 状态 [非空]   0:审核中 1:审核通过 2:审核拒绝 3:禁用账号    
	**/
	public Short getStatus(){
		
		if(this.status!=null){
			return this.status;
		}
		
		return this.status;
	}
	/**
	* 获取状态格式化(toString)
	**/
	public String getStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getStatus()),"0"))
			strValue=Utils.string("审核中");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"1"))
			strValue=Utils.string("审核通过");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"2"))
			strValue=Utils.string("审核拒绝");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"3"))
			strValue=Utils.string("禁用账号");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据状态反格式化
	**/
	public void setStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.status=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"审核中"))
		 	this.status=Utils.parseShort("0");
			
		 if(Utils.equals(strValue,"审核通过"))
		 	this.status=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"审核拒绝"))
		 	this.status=Utils.parseShort("2");
			
		 if(Utils.equals(strValue,"禁用账号"))
		 	this.status=Utils.parseShort("3");
			
		
	 
	}
	
	/**
	* 状态 [非空]   0:审核中 1:审核通过 2:审核拒绝 3:禁用账号    
	**/
	public void setStatus(Short status){
		this.status = status;
		
		this.setSeted(F.status);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(Distributor.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(Distributor.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(Distributor.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(Distributor.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(Distributor.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${Distributor.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Distributor.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Distributor.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(Distributor.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${Distributor.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Distributor.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Distributor.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(Distributor.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M id(Object id){if(proxy)return proxy().id(id);  this.put("id", id);return this;};
	 	/** and id is null */
 		public M idNull(){if(proxy)return proxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
 		/** not .... */
 		public M idNot(){if(proxy)return proxy().idNot();this.put("idNot", "not");return this;};
 		public M idNotNull(){if(proxy)return proxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
 		public M idNot(Object id){if(proxy)return proxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	 		
		/** and id <= ? */
		public M idMin(Object min){if(proxy)return proxy().idMin(min);this.put("idMin", min);return this;};
		/** and id >= ? */
		public M idMax(Object max){if(proxy)return proxy().idMax(max);this.put("idMax", max);return this;};
			
			
		public M idIn(String ids){
			if(proxy)return proxy().idIn(ids);  this.put("idIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 配送商名称 [非空]       **/
		public M name(Object name){if(proxy)return proxy().name(name);  this.put("name", name);return this;};
	 	/** and name is null */
 		public M nameNull(){if(proxy)return proxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
 		/** not .... */
 		public M nameNot(){if(proxy)return proxy().nameNot();this.put("nameNot", "not");return this;};
 		public M nameNotNull(){if(proxy)return proxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
 		public M nameNot(Object name){if(proxy)return proxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	 		
			
		
			
	 	
			
		
		/** 店面图片        **/
		public M shopPicture(Object shopPicture){if(proxy)return proxy().shopPicture(shopPicture);  this.put("shopPicture", shopPicture);return this;};
	 	/** and shop_picture is null */
 		public M shopPictureNull(){if(proxy)return proxy().shopPictureNull();if(this.get("shopPictureNot")==null)this.put("shopPictureNot", "");this.put("shopPicture", null);return this;};
 		/** not .... */
 		public M shopPictureNot(){if(proxy)return proxy().shopPictureNot();this.put("shopPictureNot", "not");return this;};
 		public M shopPictureNotNull(){if(proxy)return proxy().shopPictureNotNull();this.put("shopPictureNot", "not");this.put("shopPicture", null);return this;};
 		public M shopPictureNot(Object shopPicture){if(proxy)return proxy().shopPictureNot(shopPicture);this.put("shopPictureNot", "not");this.put("shopPicture", shopPicture);return this;};
	 		
			
		
			
	 	
			
		
		/** 手机号 [非空]       **/
		public M mobile(Object mobile){if(proxy)return proxy().mobile(mobile);  this.put("mobile", mobile);return this;};
	 	/** and mobile is null */
 		public M mobileNull(){if(proxy)return proxy().mobileNull();if(this.get("mobileNot")==null)this.put("mobileNot", "");this.put("mobile", null);return this;};
 		/** not .... */
 		public M mobileNot(){if(proxy)return proxy().mobileNot();this.put("mobileNot", "not");return this;};
 		public M mobileNotNull(){if(proxy)return proxy().mobileNotNull();this.put("mobileNot", "not");this.put("mobile", null);return this;};
 		public M mobileNot(Object mobile){if(proxy)return proxy().mobileNot(mobile);this.put("mobileNot", "not");this.put("mobile", mobile);return this;};
	 		
			
		
			
	 	
			
		
		/** 联系人        **/
		public M contacts(Object contacts){if(proxy)return proxy().contacts(contacts);  this.put("contacts", contacts);return this;};
	 	/** and contacts is null */
 		public M contactsNull(){if(proxy)return proxy().contactsNull();if(this.get("contactsNot")==null)this.put("contactsNot", "");this.put("contacts", null);return this;};
 		/** not .... */
 		public M contactsNot(){if(proxy)return proxy().contactsNot();this.put("contactsNot", "not");return this;};
 		public M contactsNotNull(){if(proxy)return proxy().contactsNotNull();this.put("contactsNot", "not");this.put("contacts", null);return this;};
 		public M contactsNot(Object contacts){if(proxy)return proxy().contactsNot(contacts);this.put("contactsNot", "not");this.put("contacts", contacts);return this;};
	 		
			
		
			
	 	
			
		
		/** 密码 [非空]       **/
		public M password(Object password){if(proxy)return proxy().password(password);  this.put("password", password);return this;};
	 	/** and password is null */
 		public M passwordNull(){if(proxy)return proxy().passwordNull();if(this.get("passwordNot")==null)this.put("passwordNot", "");this.put("password", null);return this;};
 		/** not .... */
 		public M passwordNot(){if(proxy)return proxy().passwordNot();this.put("passwordNot", "not");return this;};
 		public M passwordNotNull(){if(proxy)return proxy().passwordNotNull();this.put("passwordNot", "not");this.put("password", null);return this;};
 		public M passwordNot(Object password){if(proxy)return proxy().passwordNot(password);this.put("passwordNot", "not");this.put("password", password);return this;};
	 		
			
		
			
	 	
			
		
		/** 配送商地址        **/
		public M address(Object address){if(proxy)return proxy().address(address);  this.put("address", address);return this;};
	 	/** and address is null */
 		public M addressNull(){if(proxy)return proxy().addressNull();if(this.get("addressNot")==null)this.put("addressNot", "");this.put("address", null);return this;};
 		/** not .... */
 		public M addressNot(){if(proxy)return proxy().addressNot();this.put("addressNot", "not");return this;};
 		public M addressNotNull(){if(proxy)return proxy().addressNotNull();this.put("addressNot", "not");this.put("address", null);return this;};
 		public M addressNot(Object address){if(proxy)return proxy().addressNot(address);this.put("addressNot", "not");this.put("address", address);return this;};
	 		
			
		
			
	 	
			
		public M location$on(Region.M value){if(proxy)return proxy().location$on(value);this.put("Location", value);value.put("on", "location");return this;};
 				
 			
		
		/** 所在地  [Region]      **/
		public M location(Object location){if(proxy)return proxy().location(location);  this.put("location", location);return this;};
	 	/** and location is null */
 		public M locationNull(){if(proxy)return proxy().locationNull();if(this.get("locationNot")==null)this.put("locationNot", "");this.put("location", null);return this;};
 		/** not .... */
 		public M locationNot(){if(proxy)return proxy().locationNot();this.put("locationNot", "not");return this;};
 		public M locationNotNull(){if(proxy)return proxy().locationNotNull();this.put("locationNot", "not");this.put("location", null);return this;};
 		public M locationNot(Object location){if(proxy)return proxy().locationNot(location);this.put("locationNot", "not");this.put("location", location);return this;};
	 		
			
		public M locationIn(String ids){
			if(proxy)return proxy().locationIn(ids);  this.put("locationIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M member$on(Member.M value){if(proxy)return proxy().member$on(value);this.put("Member", value);value.put("on", "member");return this;};
 				
 			
		
		/** 会员信息 [非空] [Member]      **/
		public M member(Object member){if(proxy)return proxy().member(member);  this.put("member", member);return this;};
	 	/** and member is null */
 		public M memberNull(){if(proxy)return proxy().memberNull();if(this.get("memberNot")==null)this.put("memberNot", "");this.put("member", null);return this;};
 		/** not .... */
 		public M memberNot(){if(proxy)return proxy().memberNot();this.put("memberNot", "not");return this;};
 		public M memberNotNull(){if(proxy)return proxy().memberNotNull();this.put("memberNot", "not");this.put("member", null);return this;};
 		public M memberNot(Object member){if(proxy)return proxy().memberNot(member);this.put("memberNot", "not");this.put("member", member);return this;};
	 		
			
		public M memberIn(String ids){
			if(proxy)return proxy().memberIn(ids);  this.put("memberIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 会员名称        **/
		public M nickName(Object nickName){if(proxy)return proxy().nickName(nickName);  this.put("nickName", nickName);return this;};
	 	/** and nick_name is null */
 		public M nickNameNull(){if(proxy)return proxy().nickNameNull();if(this.get("nickNameNot")==null)this.put("nickNameNot", "");this.put("nickName", null);return this;};
 		/** not .... */
 		public M nickNameNot(){if(proxy)return proxy().nickNameNot();this.put("nickNameNot", "not");return this;};
 		public M nickNameNotNull(){if(proxy)return proxy().nickNameNotNull();this.put("nickNameNot", "not");this.put("nickName", null);return this;};
 		public M nickNameNot(Object nickName){if(proxy)return proxy().nickNameNot(nickName);this.put("nickNameNot", "not");this.put("nickName", nickName);return this;};
	 		
			
		
			
	 	
			
		
		/** 提货时间        **/
		public M deliveryTime(Object deliveryTime){if(proxy)return proxy().deliveryTime(deliveryTime);  this.put("deliveryTime", deliveryTime);return this;};
	 	/** and delivery_time is null */
 		public M deliveryTimeNull(){if(proxy)return proxy().deliveryTimeNull();if(this.get("deliveryTimeNot")==null)this.put("deliveryTimeNot", "");this.put("deliveryTime", null);return this;};
 		/** not .... */
 		public M deliveryTimeNot(){if(proxy)return proxy().deliveryTimeNot();this.put("deliveryTimeNot", "not");return this;};
 		public M deliveryTimeNotNull(){if(proxy)return proxy().deliveryTimeNotNull();this.put("deliveryTimeNot", "not");this.put("deliveryTime", null);return this;};
 		public M deliveryTimeNot(Object deliveryTime){if(proxy)return proxy().deliveryTimeNot(deliveryTime);this.put("deliveryTimeNot", "not");this.put("deliveryTime", deliveryTime);return this;};
	 		
			
		
			
	 	
			
		
		/** 经度        **/
		public M longitude(Object longitude){if(proxy)return proxy().longitude(longitude);  this.put("longitude", longitude);return this;};
	 	/** and longitude is null */
 		public M longitudeNull(){if(proxy)return proxy().longitudeNull();if(this.get("longitudeNot")==null)this.put("longitudeNot", "");this.put("longitude", null);return this;};
 		/** not .... */
 		public M longitudeNot(){if(proxy)return proxy().longitudeNot();this.put("longitudeNot", "not");return this;};
 		public M longitudeNotNull(){if(proxy)return proxy().longitudeNotNull();this.put("longitudeNot", "not");this.put("longitude", null);return this;};
 		public M longitudeNot(Object longitude){if(proxy)return proxy().longitudeNot(longitude);this.put("longitudeNot", "not");this.put("longitude", longitude);return this;};
	 		
			
		
			
	 	
			
		
		/** 纬度        **/
		public M latitude(Object latitude){if(proxy)return proxy().latitude(latitude);  this.put("latitude", latitude);return this;};
	 	/** and latitude is null */
 		public M latitudeNull(){if(proxy)return proxy().latitudeNull();if(this.get("latitudeNot")==null)this.put("latitudeNot", "");this.put("latitude", null);return this;};
 		/** not .... */
 		public M latitudeNot(){if(proxy)return proxy().latitudeNot();this.put("latitudeNot", "not");return this;};
 		public M latitudeNotNull(){if(proxy)return proxy().latitudeNotNull();this.put("latitudeNot", "not");this.put("latitude", null);return this;};
 		public M latitudeNot(Object latitude){if(proxy)return proxy().latitudeNot(latitude);this.put("latitudeNot", "not");this.put("latitude", latitude);return this;};
	 		
			
		
			
	 	
			
		
		/** 条款情况    1:同意 2:不同意     **/
		public M termsConditions(Object termsConditions){if(proxy)return proxy().termsConditions(termsConditions);  this.put("termsConditions", termsConditions);return this;};
	 	/** and terms_conditions is null */
 		public M termsConditionsNull(){if(proxy)return proxy().termsConditionsNull();if(this.get("termsConditionsNot")==null)this.put("termsConditionsNot", "");this.put("termsConditions", null);return this;};
 		/** not .... */
 		public M termsConditionsNot(){if(proxy)return proxy().termsConditionsNot();this.put("termsConditionsNot", "not");return this;};
 		public M termsConditionsNotNull(){if(proxy)return proxy().termsConditionsNotNull();this.put("termsConditionsNot", "not");this.put("termsConditions", null);return this;};
 		public M termsConditionsNot(Object termsConditions){if(proxy)return proxy().termsConditionsNot(termsConditions);this.put("termsConditionsNot", "not");this.put("termsConditions", termsConditions);return this;};
	 		
			
		public M termsConditionsIn(String ids){
			if(proxy)return proxy().termsConditionsIn(ids);  this.put("termsConditionsIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 资料完善    1:未完善 2:已完善     **/
		public M perfectSituation(Object perfectSituation){if(proxy)return proxy().perfectSituation(perfectSituation);  this.put("perfectSituation", perfectSituation);return this;};
	 	/** and perfect_situation is null */
 		public M perfectSituationNull(){if(proxy)return proxy().perfectSituationNull();if(this.get("perfectSituationNot")==null)this.put("perfectSituationNot", "");this.put("perfectSituation", null);return this;};
 		/** not .... */
 		public M perfectSituationNot(){if(proxy)return proxy().perfectSituationNot();this.put("perfectSituationNot", "not");return this;};
 		public M perfectSituationNotNull(){if(proxy)return proxy().perfectSituationNotNull();this.put("perfectSituationNot", "not");this.put("perfectSituation", null);return this;};
 		public M perfectSituationNot(Object perfectSituation){if(proxy)return proxy().perfectSituationNot(perfectSituation);this.put("perfectSituationNot", "not");this.put("perfectSituation", perfectSituation);return this;};
	 		
		/** and perfect_situation <= ? */
		public M perfectSituationMin(Object min){if(proxy)return proxy().perfectSituationMin(min);this.put("perfectSituationMin", min);return this;};
		/** and perfect_situation >= ? */
		public M perfectSituationMax(Object max){if(proxy)return proxy().perfectSituationMax(max);this.put("perfectSituationMax", max);return this;};
			
			
		public M perfectSituationIn(String ids){
			if(proxy)return proxy().perfectSituationIn(ids);  this.put("perfectSituationIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 坐标地址        **/
		public M coordinateAddress(Object coordinateAddress){if(proxy)return proxy().coordinateAddress(coordinateAddress);  this.put("coordinateAddress", coordinateAddress);return this;};
	 	/** and coordinate_address is null */
 		public M coordinateAddressNull(){if(proxy)return proxy().coordinateAddressNull();if(this.get("coordinateAddressNot")==null)this.put("coordinateAddressNot", "");this.put("coordinateAddress", null);return this;};
 		/** not .... */
 		public M coordinateAddressNot(){if(proxy)return proxy().coordinateAddressNot();this.put("coordinateAddressNot", "not");return this;};
 		public M coordinateAddressNotNull(){if(proxy)return proxy().coordinateAddressNotNull();this.put("coordinateAddressNot", "not");this.put("coordinateAddress", null);return this;};
 		public M coordinateAddressNot(Object coordinateAddress){if(proxy)return proxy().coordinateAddressNot(coordinateAddress);this.put("coordinateAddressNot", "not");this.put("coordinateAddress", coordinateAddress);return this;};
	 		
			
		
			
	 	
			
		
		/** 审核意见        **/
		public M auditOpinion(Object auditOpinion){if(proxy)return proxy().auditOpinion(auditOpinion);  this.put("auditOpinion", auditOpinion);return this;};
	 	/** and audit_opinion is null */
 		public M auditOpinionNull(){if(proxy)return proxy().auditOpinionNull();if(this.get("auditOpinionNot")==null)this.put("auditOpinionNot", "");this.put("auditOpinion", null);return this;};
 		/** not .... */
 		public M auditOpinionNot(){if(proxy)return proxy().auditOpinionNot();this.put("auditOpinionNot", "not");return this;};
 		public M auditOpinionNotNull(){if(proxy)return proxy().auditOpinionNotNull();this.put("auditOpinionNot", "not");this.put("auditOpinion", null);return this;};
 		public M auditOpinionNot(Object auditOpinion){if(proxy)return proxy().auditOpinionNot(auditOpinion);this.put("auditOpinionNot", "not");this.put("auditOpinion", auditOpinion);return this;};
	 		
			
		
			
	 	
			
		
		/** formId        **/
		public M dFormid(Object dFormid){if(proxy)return proxy().dFormid(dFormid);  this.put("dFormid", dFormid);return this;};
	 	/** and d_formid is null */
 		public M dFormidNull(){if(proxy)return proxy().dFormidNull();if(this.get("dFormidNot")==null)this.put("dFormidNot", "");this.put("dFormid", null);return this;};
 		/** not .... */
 		public M dFormidNot(){if(proxy)return proxy().dFormidNot();this.put("dFormidNot", "not");return this;};
 		public M dFormidNotNull(){if(proxy)return proxy().dFormidNotNull();this.put("dFormidNot", "not");this.put("dFormid", null);return this;};
 		public M dFormidNot(Object dFormid){if(proxy)return proxy().dFormidNot(dFormid);this.put("dFormidNot", "not");this.put("dFormid", dFormid);return this;};
	 		
			
		
			
	 	
			
		
		/** 修改时间 [非空]       **/
		public M updateTime(Object updateTime){if(proxy)return proxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	 	/** and update_time is null */
 		public M updateTimeNull(){if(proxy)return proxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
 		/** not .... */
 		public M updateTimeNot(){if(proxy)return proxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
 		public M updateTimeNotNull(){if(proxy)return proxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
 		public M updateTimeNot(Object updateTime){if(proxy)return proxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	 		
 		/** and update_time >= ? */
 		public M updateTimeStart(Object start){if(proxy)return proxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
 		/** and update_time <= ? */
 		public M updateTimeEnd(Object end){if(proxy)return proxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 添加时间 [非空]       **/
		public M addTime(Object addTime){if(proxy)return proxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	 	/** and add_time is null */
 		public M addTimeNull(){if(proxy)return proxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
 		/** not .... */
 		public M addTimeNot(){if(proxy)return proxy().addTimeNot();this.put("addTimeNot", "not");return this;};
 		public M addTimeNotNull(){if(proxy)return proxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
 		public M addTimeNot(Object addTime){if(proxy)return proxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	 		
 		/** and add_time >= ? */
 		public M addTimeStart(Object start){if(proxy)return proxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
 		/** and add_time <= ? */
 		public M addTimeEnd(Object end){if(proxy)return proxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 状态 [非空]   0:审核中 1:审核通过 2:审核拒绝 3:禁用账号     **/
		public M status(Object status){if(proxy)return proxy().status(status);  this.put("status", status);return this;};
	 	/** and status is null */
 		public M statusNull(){if(proxy)return proxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
 		/** not .... */
 		public M statusNot(){if(proxy)return proxy().statusNot();this.put("statusNot", "not");return this;};
 		public M statusNotNull(){if(proxy)return proxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
 		public M statusNot(Object status){if(proxy)return proxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	 		
			
		public M statusIn(String ids){
			if(proxy)return proxy().statusIn(ids);  this.put("statusIn", ids);return this;
		};	
 			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有配送商信息 **/
		public @api List<Distributor> list(Integer size){			
			return getDistributorList(this,size);
		}
		/** 获取配送商信息分页 **/
		public @api Page<Distributor> page(Integer page,Integer size){			
			return getDistributorPage(page, size , this);
		}
		/** 根据查询条件取配送商信息 **/
		public @api Distributor get(){			
			return getDistributor(this);
		}
		/** 获取配送商信息数 **/
		public @api Long count(){			
			return getDistributorCount(this);
		}
		/** 获取配送商信息表达式 **/
		public @api <T> T eval(String strEval){			
			return getDistributorEval(strEval,this);
		}
		
		/** 获取配送商信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getDistributorStats(this,sumKey,groupKey,dateType);
		}
		/** 获取配送商信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getDistributorStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateDistributor(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteDistributor(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String id="id";
	 			
			
	 	
			
		/** 配送商名称 [非空]       **/
		public final static @type(String.class) @like String name="name";
	 			
			
	 	
			
		/** 店面图片        **/
		public final static @type(String.class)  String shopPicture="shopPicture";
	 			
			
	 	
			
		/** 手机号 [非空]       **/
		public final static @type(String.class) @like String mobile="mobile";
	 			
			
	 	
			
		/** 联系人        **/
		public final static @type(String.class)  String contacts="contacts";
	 			
			
	 	
			
		/** 密码 [非空]       **/
		public final static @type(String.class)  String password="password";
	 			
			
	 	
			
		/** 配送商地址        **/
		public final static @type(String.class) @like String address="address";
	 			
			
	 	
			
		/** 所在地  [Region]      **/
		public final static @type(Long.class)  String location="location";
	 			
			
	 	
			
		/** 会员信息 [非空] [Member]      **/
		public final static @type(Long.class)  String member="member";
	 			
			
	 	
			
		/** 会员名称        **/
		public final static @type(String.class) @like String nickName="nickName";
	 			
			
	 	
			
		/** 提货时间        **/
		public final static @type(String.class)  String deliveryTime="deliveryTime";
	 			
			
	 	
			
		/** 经度        **/
		public final static @type(String.class)  String longitude="longitude";
	 			
			
	 	
			
		/** 纬度        **/
		public final static @type(String.class)  String latitude="latitude";
	 			
			
	 	
			
		/** 条款情况    1:同意 2:不同意     **/
		public final static @type(Short.class)  String termsConditions="termsConditions";
	 			
			
	 	
			
		/** 资料完善    1:未完善 2:已完善     **/
		public final static @type(Short.class)  String perfectSituation="perfectSituation";
	 			
		/** and perfect_situation >= ? */
		public final static @type(Short.class) String perfectSituationMin="perfectSituationMin";
		/** and perfect_situation <= ? */
		public final static @type(Short.class) String perfectSituationMax="perfectSituationMax";
				
			
	 	
			
		/** 坐标地址        **/
		public final static @type(String.class) @like String coordinateAddress="coordinateAddress";
	 			
			
	 	
			
		/** 审核意见        **/
		public final static @type(String.class) @like String auditOpinion="auditOpinion";
	 			
			
	 	
			
		/** formId        **/
		public final static @type(String.class)  String dFormid="dFormid";
	 			
			
	 	
			
		/** 修改时间 [非空]       **/
		public final static @type(Date.class)  String updateTime="updateTime";
	 			
	 	/** and update_time >= ? */
 		public final static @type(Date.class) String updateTimeStart="updateTimeStart";
 		/** and update_time <= ? */
 		public final static @type(Date.class) String updateTimeEnd="updateTimeEnd";
				
			
	 	
			
		/** 添加时间 [非空]       **/
		public final static @type(Date.class)  String addTime="addTime";
	 			
	 	/** and add_time >= ? */
 		public final static @type(Date.class) String addTimeStart="addTimeStart";
 		/** and add_time <= ? */
 		public final static @type(Date.class) String addTimeEnd="addTimeEnd";
				
			
	 	
			
		/** 状态 [非空]   0:审核中 1:审核通过 2:审核拒绝 3:禁用账号     **/
		public final static @type(Short.class)  String status="status";
	 			
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		id("id"),
		name("name"),
		shopPicture("shop_picture"),
		mobile("mobile"),
		contacts("contacts"),
		password("password"),
		address("address"),
		location("location"),
		member("member"),
		nickName("nick_name"),
		deliveryTime("delivery_time"),
		longitude("longitude"),
		latitude("latitude"),
		termsConditions("terms_conditions"),
		perfectSituation("perfect_situation"),
		coordinateAddress("coordinate_address"),
		auditOpinion("audit_opinion"),
		dFormid("d_formid"),
		updateTime("update_time"),
		addTime("add_time"),
		status("status"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取配送商信息数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = Distributor.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = Distributor.getDistributor(params);
			else
				value = Distributor.getDistributorList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  Distributor.where().id(param).get();
		else if(!Utils.empty(param.toString()))
			value = Distributor.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getId());
	
		Utils.fms(map,simple?"":"id",this.getId(),this.getId$());
		
			
 		
	
		Utils.fms(map,simple?"":"name",this.getName(),this.getName$());
		
			
 		
	
		Utils.fms(map,simple?"picture":"shopPicture",this.getShopPicture(),this.getShopPicture$());
		
			
 		
	
		Utils.fms(map,simple?"":"mobile",this.getMobile(),this.getMobile$());
		
			
 		
	
		Utils.fms(map,simple?"":"contacts",this.getContacts(),this.getContacts$());
		
			
 		
	
		Utils.fms(map,simple?"":"password",this.getPassword(),this.getPassword$());
		
			
 		
	
		Utils.fms(map,simple?"":"address",this.getAddress(),this.getAddress$());
		
			
 		
	
		Utils.fms(map,simple?"":"location",this.getLocation(),this.getLocation$());
		
			
 		
	
		Utils.fms(map,simple?"":"member",this.getMember(),this.getMember$());
		
			
 		
	
		Utils.fms(map,simple?"name":"nickName",this.getNickName(),this.getNickName$());
		
			
 		
	
		Utils.fms(map,simple?"time":"deliveryTime",this.getDeliveryTime(),this.getDeliveryTime$());
		
			
 		
	
		Utils.fms(map,simple?"":"longitude",this.getLongitude(),this.getLongitude$());
		
			
 		
	
		Utils.fms(map,simple?"":"latitude",this.getLatitude(),this.getLatitude$());
		
			
 		
	
		Utils.fms(map,simple?"conditions":"termsConditions",this.getTermsConditions(),this.getTermsConditions$());
		
			
 		
	
		Utils.fms(map,simple?"situation":"perfectSituation",this.getPerfectSituation(),this.getPerfectSituation$());
		
			
 		
	
		Utils.fms(map,simple?"address":"coordinateAddress",this.getCoordinateAddress(),this.getCoordinateAddress$());
		
			
 		
	
		Utils.fms(map,simple?"opinion":"auditOpinion",this.getAuditOpinion(),this.getAuditOpinion$());
		
			
 		
	
		Utils.fms(map,simple?"formid":"dFormid",this.getdFormid(),this.getdFormid$());
		
			
 		
	
		Utils.fms(map,simple?"time":"updateTime",this.getUpdateTime(),this.getUpdateTime$());
		
			
 		
	
		Utils.fms(map,simple?"time":"addTime",this.getAddTime(),this.getAddTime$());
		
			
 		
	
		Utils.fms(map,simple?"":"status",this.getStatus(),this.getStatus$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("id",this.getId());
 		
	
		map.put("name",this.getName());
 		
	
		map.put("shopPicture",this.getShopPicture());
 		
	
		map.put("mobile",this.getMobile());
 		
	
		map.put("contacts",this.getContacts());
 		
	
		map.put("password",this.getPassword());
 		
	
		map.put("address",this.getAddress());
 		
	
		map.put("location",this.getLocation());
 		
	
		map.put("member",this.getMember());
 		
	
		map.put("nickName",this.getNickName());
 		
	
		map.put("deliveryTime",this.getDeliveryTime());
 		
	
		map.put("longitude",this.getLongitude());
 		
	
		map.put("latitude",this.getLatitude());
 		
	
		map.put("termsConditions",this.getTermsConditions());
 		
	
		map.put("perfectSituation",this.getPerfectSituation());
 		
	
		map.put("coordinateAddress",this.getCoordinateAddress());
 		
	
		map.put("auditOpinion",this.getAuditOpinion());
 		
	
		map.put("dFormid",this.getdFormid());
 		
	
		map.put("updateTime",this.getUpdateTime());
 		
	
		map.put("addTime",this.getAddTime());
 		
	
		map.put("status",this.getStatus());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static Distributor fromMap(Map map){
		Distributor distributor = new Distributor();
	
		distributor.id = Utils.parseLong(map.get("id"));
 		
	
		distributor.name = Utils.parseString(map.get("name"));
 		
	
		distributor.shopPicture = Utils.parseString(map.get("shopPicture"));
 		
	
		distributor.mobile = Utils.parseString(map.get("mobile"));
 		
	
		distributor.contacts = Utils.parseString(map.get("contacts"));
 		
	
		distributor.password = Utils.parseString(map.get("password"));
 		
	
		distributor.address = Utils.parseString(map.get("address"));
 		
	
		distributor.location = Utils.parseLong(map.get("location"));
 		
	
		distributor.member = Utils.parseLong(map.get("member"));
 		
	
	
		distributor.deliveryTime = Utils.parseString(map.get("deliveryTime"));
 		
	
		distributor.longitude = Utils.parseString(map.get("longitude"));
 		
	
		distributor.latitude = Utils.parseString(map.get("latitude"));
 		
	
		distributor.termsConditions = Utils.parseShort(map.get("termsConditions"));
 		
	
		distributor.perfectSituation = Utils.parseShort(map.get("perfectSituation"));
 		
	
		distributor.coordinateAddress = Utils.parseString(map.get("coordinateAddress"));
 		
	
		distributor.auditOpinion = Utils.parseString(map.get("auditOpinion"));
 		
	
		distributor.dFormid = Utils.parseString(map.get("dFormid"));
 		
	
		distributor.updateTime = Utils.parseDate(map.get("updateTime"));
 		
	
		distributor.addTime = Utils.parseDate(map.get("addTime"));
 		
	
		distributor.status = Utils.parseShort(map.get("status"));
 		
	
		return distributor;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(Distributor old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/20376_LorryGreen.png";
	}
	public static String getIconfont(){
		return "icon-huoche2";
	}
	public static enum ACT{
		列表,添加,修改,详情,审核通过,审核拒绝
	};
	public static String getUrl(ACT act,Distributor.M params){
		if(params==null)params=new Distributor.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/delivery/distributor.edit.html?";
		if(params.get("id")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("id"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/delivery/distributor.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}else if(act==ACT.审核通过){
			strUrl+="&edittype=adopt";			
		
		}else if(act==ACT.审核拒绝){
			strUrl+="&edittype=refuse";			
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.id(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(Distributor.ACT act,Distributor.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",Distributor.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(Distributor.ACT act,Distributor.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",Distributor.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.IDistributorDao getDistributorDao(){
		return Utils.getBean("distributorDao");
	};
	
}